import React,{useState} from 'react'
import { Navigate } from 'react-router-dom'
export default function Home() {
    const [sum,setSum] = useState(1)

    return (
        <div>
            <h3>我是Home的内容</h3>
            <h4>sum :{sum}</h4>
            {sum%2===0? <Navigate to='/about'/>:''}
            <button onClick={()=>setSum(sum+1)}>click me update sum</button>
        </div>
        
    )
}
